<template>
	<view class="details-page">
		<!-- 顶部大图 -->
		<image class="top-img" src="http://1.94.233.8:19000/education-bucket/ec4ea3ac-bfca-47bd-9fca-3d9ce099b115.jpg"
			mode="aspectFill" />
		<!-- 白色内容卡片 -->
		<view class="price-card">
			<view class="price-row">
				<view class="price-icon">￥</view>
				<view class="price-now">1680.00</view>
				<view class="price-old">1999</view>
			</view>
			<view class="goods-title">少儿绘画</view>
			<view class="count-row">
				<view class="count-label">数量</view>
				<u-number-box v-model="value" @change="valChange" bgColor="#fff"/>
			</view>
			<view class="goods-detail-box">
				<view class="goods-detail-label">商品详情</view>
			</view>
			<!-- 卡片内底部操作栏 -->
			<view class="bottom-bar">
				<view class="bottom-icon">
					<u-icon size="40" name="star"></u-icon>
					<text>收藏</text>
				</view>
				<view class="bottom-icon">
					<u-icon size="40" name="star"></u-icon>
					<text>购物车</text>
				</view>
				<button class="buy-btn">购买</button>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: 1
			}
		},
		methods: {
			valChange(e) {
				console.log('当前值为: ' + e.value)
			},
			goToDetail(item) {
				uni.navigateTo({
					url: '/pages/shop- details/shop- details'
				});
			}
		}
	}
</script>

<style scoped>
	.details-page {
		background: #f6f8fc;
		min-height: 100vh;
		padding: 0;
		display: flex;
		flex-direction: column;
	}

	.top-img {
		width: 100vw;
		height: 180px;
		object-fit: cover;
		display: block;
	}

	.price-card {
		background: #fff;
		border-radius: 16px;
		margin: 24px auto 0 auto;
		width: calc(100vw - 60px);
		max-width: 400px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
		padding: 16px 16px 0 16px;
		border: 1px solid #e5e7eb;
		position: relative;
		z-index: 2;
		display: flex;
		flex-direction: column;
		min-height: 60vh;
		height: auto;
	}

	.price-card-content {
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.price-row {
		background: #ff8a7a;
		border-radius: 12px;
		display: flex;
		align-items: center;
		padding: 6px 16px;
		width: fit-content;
		margin-bottom: 12px;
	}

	.price-icon {
		width: 24px;
		height: 24px;
		background: #fff;
		color: #ff8a7a;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 18px;
		font-weight: bold;
		margin-right: 4px;
	}

	.price-now {
		font-size: 20px;
		color: #fff;
		font-weight: bold;
		margin-right: 10px;
	}

	.price-old {
		font-size: 15px;
		color: #fff;
		text-decoration: line-through;
		opacity: 0.7;
	}

	.goods-title {
		font-size: 17px;
		color: #222;
		font-weight: bold;
		margin: 10px 0 12px 0;
	}

	.goods-detail-box {
		border: 1px solid #e5e7eb;
		border-radius: 6px;
		background: #fff;
		padding: 12px;
		margin: 16px 0 0 0;
		min-height: 80px;
	}

	.goods-detail-label {
		color: #888;
		font-size: 15px;
	}

	.count-row {
		display: flex;
		align-items: center;
		margin-bottom: 10px;
	}

	.count-label {
		font-size: 15px;
		color: #222;
		margin-right: 18px;
	}

	.count-ctrl {
		display: flex;
		align-items: center;
		background: #fff;
		border-radius: 6px;
		border: 1px solid #e5e7eb;
		padding: 2px 8px;
	}

	.count-btn {
		width: 24px;
		height: 24px;
		border: none;
		background: #f6f8fc;
		color: #222;
		font-size: 18px;
		border-radius: 4px;
		margin: 0 4px;
	}

	.count-num {
		width: 24px;
		text-align: center;
		font-size: 15px;
		color: #222;
	}

	.bottom-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 56px;
		background: #fff;
		box-shadow: none;
		margin-top: 12px;
		border-radius: 0 0 16px 16px;
	}

	.bottom-icon {
		display: flex;
		flex-direction: row;
		align-items: center;
		font-size: 15px;
		margin-left: 10px;
		color: #222;
	}

	.bottom-icon text {
		margin-left: 4px;
	}

	.buy-btn {
		background: #ff2d2d;
		color: #fff;
		font-size: 15px;
		border-radius: 6px;
		padding: 0 24px;
		height: 36px;
		line-height: 36px;
		border: none;
		font-weight: bold;
	}
</style>